package com.yutian.springbootfreemarker.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserController {

	@GetMapping("/info")
    public String getUserInfo(Model model){
        // 直接返回字符串，框架默认会去加载 classpath:/templates/ 目录下的页面
		model.addAttribute("name", "雨田");
        model.addAttribute("job", "JAVA老师");
        return "userInfo";
    }
}
